﻿
CREATE PROCEDURE [dbo].[fares_GetPlatiDocument]
	@IDDocument bigint
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	SELECT * FROM DocumentePlata dp 
	WHERE EXISTS(SELECT * FROM DocumentePlataDetaliu ddp WHERE ddp.IDDocument = @IDDocument AND dp.IDDocumentPlata=ddp.IDDocumentPlata)

END